package com.ruoyi.rescue.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.rescue.mapper.CheRescueMapper;
import com.ruoyi.rescue.domain.CheRescue;
import com.ruoyi.rescue.service.ICheRescueService;

/**
 * 救援任务Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-06-04
 */
@Service
public class CheRescueServiceImpl implements ICheRescueService 
{
    @Autowired
    private CheRescueMapper cheRescueMapper;

    /**
     * 查询救援任务
     * 
     * @param id 救援任务主键
     * @return 救援任务
     */
    @Override
    public CheRescue selectCheRescueById(Long id)
    {
        return cheRescueMapper.selectCheRescueById(id);
    }

    /**
     * 查询救援任务列表
     * 
     * @param cheRescue 救援任务
     * @return 救援任务
     */
    @Override
    public List<CheRescue> selectCheRescueList(CheRescue cheRescue)
    {
        return cheRescueMapper.selectCheRescueList(cheRescue);
    }

//救援类型
    @Override
    public String selectType(Long id) {
        return cheRescueMapper.findType(id);
    }

    /**
     * 新增救援任务
     * 
     * @param cheRescue 救援任务
     * @return 结果
     */
    @Override
    public int insertCheRescue(CheRescue cheRescue)
    {
        return cheRescueMapper.insertCheRescue(cheRescue);
    }

    /**
     * 修改救援任务
     * 
     * @param cheRescue 救援任务
     * @return 结果
     */
    @Override
    public int updateCheRescue(CheRescue cheRescue)
    {
        return cheRescueMapper.updateCheRescue(cheRescue);
    }

    /**
     * 批量删除救援任务
     * 
     * @param ids 需要删除的救援任务主键
     * @return 结果
     */
    @Override
    public int deleteCheRescueByIds(Long[] ids)
    {
        return cheRescueMapper.deleteCheRescueByIds(ids);
    }

    /**
     * 删除救援任务信息
     * 
     * @param id 救援任务主键
     * @return 结果
     */
    @Override
    public int deleteCheRescueById(Long id)
    {
        return cheRescueMapper.deleteCheRescueById(id);
    }
}
